package com.jianan.mis.data.domain.base;

import java.io.Serializable;


/**
 * This is an object that contains data related to the os_contract_material table.
 * Do not modify this class because it will be overwritten if the configuration file
 * related to this class is modified.
 *
 * @hibernate.class
 *  table="os_contract_material"
 */

public abstract class BaseOsContractMaterial  implements Serializable {

	public static String REF = "OsContractMaterial";
	public static String PROP_COLLECTED = "Collected";
	public static String PROP_MATERIAL = "Material";
	public static String PROP_ID = "Id";
	public static String PROP_OS_CONTRACT = "OsContract";
	public static String PROP_TRANSLATED = "Translated";


	// constructors
	public BaseOsContractMaterial () {
		initialize();
	}

	/**
	 * Constructor for primary key
	 */
	public BaseOsContractMaterial (java.lang.Integer id) {
		this.setId(id);
		initialize();
	}

	/**
	 * Constructor for required fields
	 */
	public BaseOsContractMaterial (
		java.lang.Integer id,
		com.jianan.mis.data.domain.OsContract osContract,
		java.lang.String material,
		boolean collected,
		boolean translated) {

		this.setId(id);
		this.setOsContract(osContract);
		this.setMaterial(material);
		this.setCollected(collected);
		this.setTranslated(translated);
		initialize();
	}

	protected void initialize () {}



	private int hashCode = Integer.MIN_VALUE;

	// primary key
	private java.lang.Integer id;

	// fields
	private java.lang.String material;
	private boolean collected;
	private boolean translated;

	// many to one
	private com.jianan.mis.data.domain.OsContract osContract;



	/**
	 * Return the unique identifier of this class
     * @hibernate.id
     *  generator-class="native"
     *  column="id"
     */
	public java.lang.Integer getId () {
		return id;
	}

	/**
	 * Set the unique identifier of this class
	 * @param id the new ID
	 */
	public void setId (java.lang.Integer id) {
		this.id = id;
		this.hashCode = Integer.MIN_VALUE;
	}




	/**
	 * Return the value associated with the column: material
	 */
	public java.lang.String getMaterial () {
		return material;
	}

	/**
	 * Set the value related to the column: material
	 * @param material the material value
	 */
	public void setMaterial (java.lang.String material) {
		this.material = material;
	}



	/**
	 * Return the value associated with the column: collected
	 */
	public boolean isCollected () {
		return collected;
	}

	/**
	 * Set the value related to the column: collected
	 * @param collected the collected value
	 */
	public void setCollected (boolean collected) {
		this.collected = collected;
	}



	/**
	 * Return the value associated with the column: translated
	 */
	public boolean isTranslated () {
		return translated;
	}

	/**
	 * Set the value related to the column: translated
	 * @param translated the translated value
	 */
	public void setTranslated (boolean translated) {
		this.translated = translated;
	}



	/**
	 * Return the value associated with the column: os_contract_id
	 */
	public com.jianan.mis.data.domain.OsContract getOsContract () {
		return osContract;
	}

	/**
	 * Set the value related to the column: os_contract_id
	 * @param osContract the os_contract_id value
	 */
	public void setOsContract (com.jianan.mis.data.domain.OsContract osContract) {
		this.osContract = osContract;
	}




	public boolean equals (Object obj) {
		if (null == obj) return false;
		if (!(obj instanceof com.jianan.mis.data.domain.OsContractMaterial)) return false;
		else {
			com.jianan.mis.data.domain.OsContractMaterial osContractMaterial = (com.jianan.mis.data.domain.OsContractMaterial) obj;
			if (null == this.getId() || null == osContractMaterial.getId()) return false;
			else return (this.getId().equals(osContractMaterial.getId()));
		}
	}

	public int hashCode () {
		if (Integer.MIN_VALUE == this.hashCode) {
			if (null == this.getId()) return super.hashCode();
			else {
				String hashStr = this.getClass().getName() + ":" + this.getId().hashCode();
				this.hashCode = hashStr.hashCode();
			}
		}
		return this.hashCode;
	}


	public String toString () {
		return super.toString();
	}


}